home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / hypercrd / xcmds / dvlprstc.hqx / Developer Stack 1.3r / card_9129.txt < prev    next >
Text File  |  1991-04-30  |  2KB  |  67 lines

  1. -- card: 9129 from stack: in.3r
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 2202
  5. -- name: PowerToggle
  6. ----- HyperTalk script -----
  7. on enterkey
  8.   if the shiftkey is down then
  9.     if the tool is "browse tool" then choose button tool
  10.     else if the tool is "button tool" then choose field tool
  11.     else choose browse tool
  12.   else
  13.     if the optionkey is down then
  14.       if the tool is "button tool" then domenu new button
  15.       else if the tool is "field tool" then domenu new field
  16.       else pass enterkey
  17.     end if
  18.   end if
  19. end enterkey
  20.  
  21.  
  22.  
  23.  
  24. -- part contents for background part 10
  25. ----- text -----
  26. 8
  27.  
  28. -- part contents for background part 3
  29. ----- text -----
  30. PowerToggle
  31.  
  32. -- part contents for background part 2
  33. ----- text -----
  34. --NOTE: Handlers are included in the Function section for convenience.
  35.  
  36. --This script is a variation of a script presented in the January 1988 issue of MacWorld.
  37. --It allows you regular use of the enterkey, but turns it into a tool toggle when the
  38. --shiftkey is held down.  Additionally it it turns into an object creator when the option key
  39. --is held down.
  40. --
  41. --When the enterkey is pressed with the shiftkey held down, the tool palette will toggle
  42. --from the browse tool to the button tool to the field tool and back to the browse tool.
  43. --
  44. --When the enterkey is pressed with the optionkey held down,  you will create a new field, 
  45. --or a new button, depending upon which tool is hilighted.
  46. --
  47. --Best place to put this is in your home stack script.  It is installed in this card. Try it!
  48. --This variation is from Steve Drazga, AnaltyX.
  49. --
  50. on enterkey
  51.    if the shifkey is down then
  52.       if the tool is "browse tool" then choose button tool
  53.       else if the tool is "button tool" then choose field tool
  54.       else choose browse tool
  55.    else
  56.       if the optionkey is down then
  57.          if the tool is "button tool" then domenu new button
  58.          else if the tool is "field tool" then domenu new field
  59.       else pass enterkey
  60.       end if
  61.    end if
  62. end enterkey
  63.  
  64.  
  65. -- part contents for background part 19
  66. ----- text -----
  67. Functions